x86/shadow: use __put_user() instead of __copy_to_user()
authorJan Beulich <jbeulich@suse.com>
Tue, 26 Jan 2021 13:13:18 +0000 (14:13 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 26 Jan 2021 13:13:18 +0000 (14:13 +0100)
commita8cd9b8aff93b5d55f126910dde77f90d973ac76
tree8ef98ab8e3aaa903de8ad92fb0459f5224c7d2bc
parentca88a43e660c75796656a544e54a648c60d26ef0
x86/shadow: use __put_user() instead of __copy_to_user()

In a subsequent patch I would almost have broken the logic here, if I
hadn't happened to read through the comment at the top of
safe_write_entry(): __copy_from_user() does not provide a guarantee
shadow_write_entries() requires - it's only an optimization that it
makes use of __put_user_size() for certain sizes. Use __put_user()
directly, which does expand to a single (memory accessing) insn.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/shadow/multi.c